package com.ruicar.afs.cloud.demo.demo.feign;

import com.ruicar.afs.cloud.common.core.feign.AfsFeignFormSupport;
import com.ruicar.afs.cloud.common.core.feign.annotations.AfsFeignClear;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.Map;

//表单方式提交样例
@FeignClient(name = "demo", url = "http://devgateway.gwmfc.com/", configuration = AfsFeignFormSupport.class)
public interface FromDemoFeign {
    @PostMapping(value = "connect/token", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    @AfsFeignClear(true)
//通过此注解防止添加内部token
    String getToken(@RequestBody Map<String, ?> data);
}
